*&---------------------------------------------------------------------*
*& 包含               ZFIU019_TOP
*&---------------------------------------------------------------------*
TABLES: EKKO,EKBE,ZFIT078_HEAD, ZFIT079_HEAD, ZFIT079_ITEM.

TYPES:  BEGIN OF TY_GR_QUERY_RESULT.
          INCLUDE TYPE  ZFIT079_ITEM.
TYPES:
          LIFNR        TYPE EKKO-LIFNR,
          LIFNR_NAME   TYPE LFA1-NAME1,
          BUKRS        TYPE EKKO-BUKRS,
          BATXT        TYPE T161T-BATXT,
          WERKS_NAME   TYPE T001W-NAME1,
          MENGE        TYPE EKPO-MENGE,
          PO_AEDAT     TYPE EKKO-AEDAT,
          PO_ERNAM     TYPE EKKO-ERNAM,
          LGOBE        TYPE T001L-LGOBE,

          GL_HKONT_TXT TYPE SKAT-TXT20,
          GL_KOSTL_TXT TYPE CSKT-KTEXT,

          SELECT       TYPE C,   "选择
          FRMDB        TYPE C,   "来自行项目表
        END OF TY_GR_QUERY_RESULT.

TYPES:
  BEGIN OF TY_EKKO_EKPO,
    EBELN      TYPE EKBE-EBELN,
    EBELP      TYPE EKBE-EBELP,
    ZEKKN      TYPE EKBE-ZEKKN,
    VGABE      TYPE EKBE-VGABE,
    GJAHR      TYPE EKBE-GJAHR,
    BELNR      TYPE EKBE-BELNR,
    BUZEI      TYPE EKBE-BUZEI,

    BWART      TYPE EKBE-BWART,
    LFGJA      TYPE EKBE-LFGJA,
    LFBNR      TYPE EKBE-LFBNR,
    LFPOS      TYPE EKBE-LFPOS,

    MENGE      TYPE EKBE-MENGE,
    WRBTR      TYPE EKBE-WRBTR,
    DMBTR      TYPE EKBE-DMBTR,
    SHKZG      TYPE EKBE-SHKZG,
    CPUDT      TYPE EKBE-CPUDT,
    CPUTM      TYPE EKBE-CPUTM,
    CHARG      TYPE EKBE-CHARG,

    BSART      TYPE EKKO-BSART,
    BATXT      TYPE T161T-BATXT,
    KNTTP      TYPE EKPO-KNTTP,
    EKORG      TYPE EKKO-EKORG,
    BUKRS      TYPE EKKO-BUKRS,
    BUTXT      TYPE T001-BUTXT,
    LIFNR      TYPE EKKO-LIFNR,
    LIFNR_NAME TYPE LFA1-NAME1,
    BEDAT      TYPE EKKO-BEDAT,
    AEDAT      TYPE EKKO-AEDAT,
    ERNAM      TYPE EKKO-ERNAM,
    WERKS      TYPE EKPO-WERKS,
    WERKS_NAME TYPE T001W-NAME1,
    MTART      TYPE EKPO-MTART,
    MATNR      TYPE EKPO-MATNR,
    MAKTX      TYPE MAKT-MAKTX,
    TXZ01      TYPE EKPO-TXZ01,
    " MENGE      TYPE EKPO-MENGE,
    MEINS      TYPE EKPO-MEINS,
    LGORT      TYPE EKPO-LGORT,
    LGOBE      TYPE T001L-LGOBE,
    WAERS      TYPE EKKO-WAERS,
    NETPR      TYPE EKPO-NETPR,
    PEINH      TYPE EKPO-PEINH,
    MWSKZ      TYPE EKPO-MWSKZ,
    WEBRE      TYPE EKPO-WEBRE,
  END OF TY_EKKO_EKPO.


TYPES:
  TT_GR_QUERY_RESULT TYPE STANDARD TABLE OF TY_GR_QUERY_RESULT,
  TT_ZFIT079_ITEM    TYPE STANDARD TABLE OF ZFIT079_ITEM,
  TT_EKKO_EKPO       TYPE STANDARD TABLE OF TY_EKKO_EKPO,
  TT_R_BUKRS         TYPE RANGE OF EKKO-BUKRS,
  TT_R_LIFNR         TYPE RANGE OF EKKO-LIFNR,
  TT_R_BSART         TYPE RANGE OF EKKO-BSART,
  TT_R_EKGRP         TYPE RANGE OF EKKO-EKGRP,
  TT_R_EBELN         TYPE RANGE OF EKKO-EBELN,
  TT_R_EBELP         TYPE RANGE OF EKPO-EBELP,
  TT_R_EBENP         TYPE RANGE OF CHAR30,
  TT_R_WERKS         TYPE RANGE OF EKPO-WERKS,
  TT_R_MATNR         TYPE RANGE OF EKPO-MATNR,
  TT_R_GJAHR         TYPE RANGE OF EKBE-GJAHR,
  TT_R_BELNR         TYPE RANGE OF EKBE-BELNR,
  TT_R_CHARG         TYPE RANGE OF EKBE-CHARG,
  TT_R_LICHA         TYPE RANGE OF MCH1-LICHA,
  TT_R_ERNAM         TYPE RANGE OF EKKO-ERNAM,
  TT_R_AEDAT         TYPE RANGE OF EKKO-AEDAT.


DATA:
  RD_GUONEI            TYPE CHAR1,
  RD_GUOWAI            TYPE CHAR1,
  RD_JISHOU            TYPE CHAR1,
  RD_BATCH_GUONEI_PO   TYPE CHAR1,
  RD_REPORT_JSD        TYPE CHAR1,
  RD_REPORT_JSD_DETAIL TYPE CHAR1,
  RD_REPORT_INV        TYPE CHAR1.

DATA:
  GV_ERROR       TYPE C,
  GV_CHARG       TYPE EKBE-CHARG,
  GV_LICHA       TYPE MCH1-LICHA,         "供应商批次编号
  GV_EBELN_EBELP TYPE CHAR30,
  GV_JSDDH       TYPE ZFIT079_HEAD-JSDDH, "其它程序传过来
  GV_MODE        TYPE CHAR3,              "显示还是编辑模式
  SAVE_OK        TYPE SY-UCOMM,
  OK_CODE        TYPE SY-UCOMM.

DATA:
  GV_SUBSCREEN_9000 TYPE SY-DYNNR.                "动态指定子屏幕区域

DATA:
  GV_POPUP_MSG TYPE STRING,
  GV_POPUP_YES TYPE C,
  GS_MSG       TYPE BAPIRET2,
  GT_ALV_DB    TYPE TABLE OF TY_GR_QUERY_RESULT WITH HEADER LINE,
  GT_ALV       TYPE TABLE OF TY_GR_QUERY_RESULT WITH HEADER LINE.

DATA:
  GT_EXTAB_BTN         TYPE SLIS_T_EXTAB,           "状态栏按钮排除
  GT_TOOLBAR_EXCLUDING TYPE UI_FUNCTIONS.           "ALV 按钮排除

*-- Global data definitions for ALV
DATA:
  GR_ALVGRID                 TYPE REF TO CL_GUI_ALV_GRID,
  GC_CUSTOM_CONTROL_NAME     TYPE SCRFNAME VALUE 'GC_ALV_AERA',
  GR_CONTAINER               TYPE REF TO CL_GUI_CUSTOM_CONTAINER,

  GR_ALVGRID_NPO             TYPE REF TO CL_GUI_ALV_GRID,
  GC_CUSTOM_CONTROL_NAME_NPO TYPE SCRFNAME VALUE 'GC_ALV_AERA_NPO',
  GR_CONTAINER_NPO           TYPE REF TO CL_GUI_CUSTOM_CONTAINER,

  GS_STABLE                  TYPE LVC_S_STBL VALUE 'XX',
  GT_FIELDCAT                TYPE LVC_T_FCAT,
  GS_LAYOUT                  TYPE LVC_S_LAYO,
  GT_EXCLUDE                 TYPE UI_FUNCTIONS,
  GS_VARIANT                 TYPE DISVARIANT.

*  OO ALV事件捕捉类
CLASS LCL_EVENT_RECEIVER DEFINITION DEFERRED.
DATA: GR_EVENT_RECEIVER TYPE REF TO LCL_EVENT_RECEIVER.


CONSTANTS:
  GC_ZYWLX_DOMESTIC    TYPE ZFIT079_HEAD-ZYWLX VALUE '01',
  GC_ZYWLX_FOREIGN     TYPE ZFIT079_HEAD-ZYWLX VALUE '02',
  GC_ZYWLX_CONSIGNMENT TYPE ZFIT079_HEAD-ZYWLX VALUE '03',
  GC_JSDLX_PO          TYPE ZFIT079_HEAD-JSDLX VALUE '01',
  GC_JSDLX_NPO         TYPE ZFIT079_HEAD-JSDLX VALUE '02',
  GC_JSDZT_DRAFT       TYPE ZFIT079_HEAD-JSDZT VALUE '01',
  GC_JSDZT_SUBMITED    TYPE ZFIT079_HEAD-JSDZT VALUE '02',
  GC_JSDZT_PROCESS     TYPE ZFIT079_HEAD-JSDZT VALUE '03',
  GC_JSDZT_DEPRECATED  TYPE ZFIT079_HEAD-JSDZT VALUE '04',
  GC_JSDZT_POSTED      TYPE ZFIT079_HEAD-JSDZT VALUE '05',
  GC_YWCL_INV          TYPE ZFIT079_HEAD-VORGANG VALUE '1',
  GC_YWCL_CRMO         TYPE ZFIT079_HEAD-VORGANG VALUE '2',
  GC_YWCL_SUBSD        TYPE ZFIT079_HEAD-VORGANG VALUE '3',
  GC_YWCL_SUBSC        TYPE ZFIT079_HEAD-VORGANG VALUE '4',
  GC_KTOPL_VAMA        TYPE SKAT-KTOPL VALUE 'VAMA',
  GC_KOKRS_1000        TYPE CSKT-KOKRS VALUE '1000',
  GC_MODE_CHANGE       TYPE CHAR3 VALUE 'CHG',
  GC_MODE_DISPLAY      TYPE CHAR3 VALUE 'DIS',
  GC_WAERS_CNY         TYPE T001-WAERS VALUE 'CNY',
  GC_SAP_OBJECT        TYPE TOAV0-SAP_OBJECT VALUE 'ZZFI_FPJSD'.
